import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
import indexM from '@/components/wap/index/index-m.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {path: '/', name: 'index', component: index},
    {path: '/park', name: 'park', component: (resolve) => require(['@/components/park/park.vue'], resolve)},
    {path: '/parkDetail/:id', name: 'parkDetail', component: (resolve) => require(['@/components/park/parkDetail.vue'], resolve)},
    {path: '/service', name: 'service', component: (resolve) => require(['@/components/service/service.vue'], resolve)},
    {path: '/capital', name: 'capital', component: (resolve) => require(['@/components/capital/capital.vue'], resolve)},
    {path: '/activity', name: 'activity', component: (resolve) => require(['@/components/activity/activity.vue'], resolve)},
    {path: '/actDetail/:id', name: 'actDetail', component: (resolve) => require(['@/components/activity/actDetail.vue'], resolve)},
    {path: '/ts-index', name: 'ts-index', component: (resolve) => require(['@/components/tiansha/ts-index.vue'], resolve)},
    {path: '/bot-link/:id', name: 'bot-link', component: (resolve) => require(['@/components/botLink/botLinks.vue'], resolve)},
    // {path: '/news', name: 'news', component: (resolve) => require(['@/components/news/news.vue'], resolve)}
    // 移动端
    {path: '/indexM', name: 'indexM', component: indexM}
  ],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})
